<style>
    .c_img{position:relative;}
    .c_words{position:absolute;top:120px;right: 35px}
</style>
<div>
    <ol class="breadcrumb" >
        <li> <i class="fa fa-anchor"></i>电桩状态</li>
        <li>状态统计</li>
        <li style="float: right">自动刷新倒计时：<span id="countdown"  style="color: white">60</span></li>
        <!--<span style="float: right"><i class="fa fa-spin c_img"><img src="__PUBLIC__/img/fenglun.png" style="width: 50px;height: 50px" title="12"/></i></span>
        <span id="countdown" class="c_words" style="color: white">60</span>-->
    </ol>
    <div class="panel">
        <div class="panel-heading">
            <i class="fa fa-list">&nbsp;&nbsp;状态信息表</i>
        </div>
        <form class="search-form" action="__ACTION__" method="get" onsubmit="return show_first_page();">
        <div class="panel-body search-panel-body">
            <div class="col-xs-5" style=" width:530px;">
                <div class="input-group">
                    <span class="input-group-addon" style="width:80px;">所在地</span>
                    <select id="location-f" name="location_f_1" class="form-control" style="width:150px;">
                        <option value="0">--</option>
                        <volist name="china" id="vo">
                            <option value="{$vo.code}">{$vo.name}</option>
                        </volist>
                    </select>

                    <select id="location-s" name="location_s_1" class="form-control" style="width:140px;border-left:0">
                        <option value="0">--</option>
                        <volist name="china" id="vo">
                            <volist name="vo['area']" id="vovo">
                                <option value="{$vovo.code}" class="{$vo.code}" >{$vovo.name}</option>
                            </volist>
                        </volist>
                    </select>

                    <select id="location-t" name="location_t_1" class="form-control required" style="width:125px;border-left:0">
                        <option value="0">--</option>
                        <volist name="china" id="vo">
                            <volist name="vo['area']" id="vovo">
                                <volist name="vovo['area']" id="vovovo">
                                    <option value="{$vovovo.code}" class="{$vovo.code}" >{$vovovo.name}</option>
                                </volist>
                            </volist>
                        </volist>
                    </select>
                </div>
            </div>
            <div class="col-xs-3 search-col">
                <div class="input-group">
                    <span class="input-group-addon">设备地址</span>
                    <input type="text" name="key_link" class="form-control" value="{$_GET['key_link']}" placeholder="设备地址"></div>
            </div>
            <div class="col-xs-2 search-col">
                <button  type="submit" class="btn btn-warning">
                    <i class="fa fa-search"></i>
                    &nbsp;搜索
                </button>
            </div>
        </div>
    <div class="indexTitle mt10" style="float: left">电桩实时状态总览 | <span class="sTitle">全国</span></div>
        <ul class="indexIconsBg" >
        <a href={:U('State/index',array('charge'=>1,'location_f_1'=>$_GET['location_f_1'],'location_s_1'=>$_GET['location_s_1'],'location_t_1'=>$_GET['location_t_1']))}>
            <li>
                <div class="iconBox in_icon2"></div>
                <div class="icon_con">
                    <div class="enTitle">CHARGE</div>
                    <div class="cnTitle c_charge">{$charge}</div>
                </div>
                <div class="numberBox icon_2_2"></div>
            </li>
        </a>
        <div class="iconFg"></div>
        <a href={:U('State/index',array('charge'=>0,'location_f_1'=>$_GET['location_f_1'],'location_s_1'=>$_GET['location_s_1'],'location_t_1'=>$_GET['location_t_1']))}>
            <li>
                <div class="iconBox in_icon3"></div>
                <div class="icon_con">
                    <div class="enTitle">RELEASE</div>
                    <div class="cnTitle c_online">{$release}</div>
                </div>
                <div class="numberBox icon_2_3"></div>
            </li>
        </a>
        <div class="iconFg"></div>
        <a href={:U('State/index',array('error'=>1,'location_f_1'=>$_GET['location_f_1'],'location_s_1'=>$_GET['location_s_1'],'location_t_1'=>$_GET['location_t_1']))}>
            <li>
                <div class="iconBox in_icon1"></div>
                <div class="icon_con">
                    <div class="enTitle">OFFLINE</div>
                    <div class="cnTitle c_offline">{$error}</div>
                </div>
                <div class="numberBox icon_2_1"></div>
            </li>
        </a>
        <div class="iconFg"></div>
        <a href={:U('State/index',array('location_f_1'=>$_GET['location_f_1'],'location_s_1'=>$_GET['location_s_1'],'location_t_1'=>$_GET['location_t_1']))}>
            <li>
                <div class="iconBox in_icon4"></div>
                <div class="icon_con">
                    <div class="enTitle">ALL</div>
                    <div class="cnTitle c_error">{$count}</div>
                </div>
                <div class="numberBox icon_2_4"></div>
            </li>
        </a>
    </ul>
    <table  class="table table-bordered table-striped table-mcit" >
    <if condition="$control eq '充电中'">
        <thead>
            <tr>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>选择</button>
                </th>
                <th >
                    <button class='btn btn-block btn-mcit' type='button'>ID</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>桩号</button>
                </th>
                <th >
                    <!--<button class='btn btn-block btn-mcit' type='button'>站点名称</button>-->
                    <button class='btn btn-block btn-mcit' type='button'>所在区域</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>电压/电流</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>输出功率</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>已充-时</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>已充-分</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>本次充电量</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>本次充电金额</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>电桩状态</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>在线情况</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>24小时</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>操作</button>
                </th>
            </tr>
        </thead>
        <tbody id="DataTableContent">
            <empty name="charState">
                <td colspan="99" style="text-align:center" class="danger"> <strong><i class="fa fa-meh-o"></i>
                    &nbsp;&nbsp;当前条件下没有数据</strong>
                </td>
                <else />
                <volist name="charState" id="data">
                    <tr class="lists" align="center">
                        <td>
                            <input type="checkbox" data-nid="{$data.evc_number}" data-id="{$data.s_key_link}" data-code="{$data.now_user}" value="{$data.id}"/>
                        </td>
                        <td>{$data.id}</td>
                        <td>{$data.charID}</td>
                        <td>{$data.location}</td>
                        <!--<td><span title="{$data.name}">{$data.name_text}</span></td>-->
                        <td>{$data.char_u} / {$data.char_i}</td>
                        <td>{$data.char_p}</td>
                        <td>{$data.char_now_hour}</td>
                        <td>{$data.char_now_minute}</td>
                        <td>{$data.char_now_kwh}</td>
                        <td>
                            <if condition="$data['char_now_money'] neq ''">
                                &yen;{$data.char_now_money}
                            <else />
                                &yen;0.00
                            </if>
                        </td>
                        <td>
                            <if condition="$data.charge eq 1 and $data.bespeak eq 0 and $data.error eq 0 and $data.cable eq 0"><span style="color: red">充电中</span><esle /></if>
                        </td>
                        <td>
                            <if condition="$data.status eq 2">
                                <span style="color: #cc6600">异常</span>
                                <elseif condition="$data.status eq 1"/>
                                <span style="color: red">下线(连续{$data.outline}天)</span>
                                <elseif condition="$data.status eq 3"/>
                                <span style="color: #009900">在线</span>
                            </if>
                        </td>
                        <td>
                            <a class="btn btn-sm {$data.colors} showState" href="#confirmDeletes" data-target="#confirmDeletes" data-toggle="modal" data-id='{$data.key_link}'>
                                <i class="glyphicon glyphicon-flash"></i>
                            </a>
                        </td>
                        <td>
                            <a class="btn btn-success btn-sm" href="__URL__/detail/id/{$data.id}">
                                <i class="fa fa-eye"></i>
                                &nbsp;查看
                            </a>
                            <a class="btn btn-danger btn-sm changehh" data-nid="{$data.evc_number}"   data-value="关闭" data-text="{$data.now_user}"  data-id="{$data.s_key_link}" data-info="确定要关闭？">
                                <i class="fa fa-sign-out"></i>
                                &nbsp;关闭
                            </a>
                            <a class="btn btn-info btn-sm changehh"  data-nid="{$data.evc_number}"   data-value="预约"  data-text="{$data.now_user}"  data-id="{$data.s_key_link}" data-info="确定开始预约吗”？">
                                <i class="fa fa-adjust"></i>
                                &nbsp;预约
                            </a>
                            <if condition="$_SESSION['role'] eq 805 or $_SESSION['role'] eq 802">
                                <a class="btn btn-sm btn-danger deleteBtn" href="#confirmDelete" data-target="#confirmDelete" data-toggle="modal" data-id='{$data.id}'><i class="fa fa-trash-o"></i>
                                    &nbsp;删除</a>
                            <else /></if>
                        </td>
                </tr>
                </volist>
            </empty>
            <tr>
                <td colspan="99">
                    <input type="button" value="全选"   class="btn selectAll">
                    <input type="button" value="全不选" class="btn unSelect" >
                    <input type="button" value="反选"   class="btn reverse" >
                    <input type="button" value="批量删除" class="btn delValues" >
                    <input type="button" value="关闭" class="btn endValues btn-danger" >
                    <input type="button" value="预约" class="btn bespeakValues btn-info" >
                </td>
            </tr>
    <elseif condition="$control eq '空闲'" />
            <thead>
            <tr>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>选择</button>
                </th>
                <th >
                    <button class='btn btn-block btn-mcit' type='button'>ID</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>桩号</button>
                </th>
                <th >
                    <button class='btn btn-block btn-mcit' type='button'>所在区域</button>
                    <!--<button class='btn btn-block btn-mcit' type='button'>站点名称</button>-->
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>电压/电流</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>输出功率</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>已充-时</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>已充-分</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>本次充电量</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>本次充电金额</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>电桩状态</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>在线情况</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>24小时</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='button'>操作</button>
                </th>
            </tr>
            </thead>
        <tbody>
        <empty name="charState">
            <td colspan="99" style="text-align:center" class="danger"> <strong><i class="fa fa-meh-o"></i>
                &nbsp;&nbsp;当前条件下没有数据</strong>
            </td>
            <else />
            <volist name="charState" id="data">
                <tr class="lists" align="center">
                    <td>
                        <input type="checkbox" data-nid="{$data.evc_number}" data-id="{$data.s_key_link}" data-code="{$data.now_user}" value="{$data.id}"/>
                    </td>
                    <td>{$data.id}</td>
                    <td>{$data.charID}</td>
                    <!--<td><span title="{$data.name}">{$data.name_text}</span></td>-->
                    <td>{$data.location}</td>
                    <td>{$data.char_u} / {$data.char_i}</td>
                    <td>{$data.char_p}</td>
                    <td>{$data.char_now_hour}</td>
                    <td>{$data.char_now_minute}</td>
                    <td>{$data.char_now_kwh}</td>
                    <td>
                        <if condition="$data['char_now_money'] neq ''">
                            &yen;{$data.char_now_money}
                            <else />
                            &yen;0.00
                        </if>
                    </td>
                    <td>
                        <if condition="$data.charge eq 0 and $data.bespeak eq 0 and $data.error eq 0 and $data.cable eq 0"><span style="color: #009900">空闲中</span><else /></if>
                    </td>
                    <td>
                        <if condition="$data.status eq 2">
                            <span style="color: #cc6600">异常</span>
                            <elseif condition="$data.status eq 1"/>
                            <span style="color: red">下线(连续{$data.outline}天)</span>
                            <elseif condition="$data.status eq 3"/>
                            <span style="color: #009900">在线</span>
                        </if>
                    </td>
                    <td>
                        <a class="btn btn-sm {$data.colors} showState" href="#confirmDeletes" data-target="#confirmDeletes" data-toggle="modal" data-id='{$data.key_link}'>
                            <i class="glyphicon glyphicon-flash"></i>
                        </a>
                    </td>
                    <td>
                        <a class="btn btn-success btn-sm" href="__URL__/detail/id/{$data.id}">
                            <i class="fa fa-eye"></i>
                            &nbsp;查看
                        </a>
                        <a class="btn btn-success btn-sm changehh" data-nid="{$data.evc_number}"  data-value="开启" data-text="{$data.now_user}"  data-id="{$data.s_key_link}" data-info="确定要开启吗？">
                            <i class="fa fa-sign-in"></i>
                            &nbsp;开启
                        </a>
                        <a class="btn btn-info btn-sm changehh"  data-nid="{$data.evc_number}"   data-value="预约"  data-text="{$data.now_user}"  data-id="{$data.s_key_link}" data-info="确定开始预约吗”？">
                            <i class="fa fa-adjust"></i>
                            &nbsp;预约
                        </a>
                        <if condition="$_SESSION['role'] eq 805 or $_SESSION['role'] eq 802">
                            <a class="btn btn-sm btn-danger deleteBtn" href="#confirmDelete" data-target="#confirmDelete" data-toggle="modal" data-id='{$data.id}'><i class="fa fa-trash-o"></i>
                                &nbsp;删除</a>
                        <else /></if>
                    </td>
                </tr>
            </volist>
        </empty>
        <tr>
            <td colspan="99">
                <input type="button" value="全选"   class="btn selectAll">
                <input type="button" value="全不选" class="btn unSelect" >
                <input type="button" value="反选"   class="btn reverse" >
                <input type="button" value="批量删除" class="btn delValues" >
                <input type="button" value="开启" class="btn startValues btn-success" >
                <input type="button" value="预约" class="btn bespeakValues btn-info" >
            </td>
        </tr>
    <elseif condition="$control eq '故障'" />
        <thead>
        <tr>
            <th>
                <button class='btn btn-block btn-mcit' type='button'>选择</button>
            </th>
            <th >
                <button class='btn btn-block btn-mcit' type='button'>ID</button>
            </th>
            <th >
                <button class='btn btn-block btn-mcit' type='button'>站点名称</button>
            </th>
            <th >
                <button class='btn btn-block btn-mcit' type='button'>所在区域</button>
            </th>
            <th>
                <button class='btn btn-block btn-mcit' type='button'>运营二维码</button>
            </th>
            <th>
                <button class='btn btn-block btn-mcit' type='button'>设备地址</button>
            </th>
            <th>
                <button class='btn btn-block btn-mcit' type='button'>电桩状态</button>
            </th>
            <th>
                <button class='btn btn-block btn-mcit' type='button'>故障时间</button>
            </th>
            <th>
                <button class='btn btn-block btn-mcit' type='button'>操作</button>
            </th>
        </tr>
        </thead>
        <tbody>
        <empty name="charState">
            <td colspan="99" style="text-align:center" class="danger"> <strong><i class="fa fa-meh-o"></i>
                &nbsp;&nbsp;当前条件下没有数据</strong>
            </td>
        <else />
            <volist name="charState" id="data">
                <tr class="lists" align="center">
                    <td>
                        <input type="checkbox"  value="{$data.id}"/>
                    </td>
                    <td>{$data.id}</td>
                    <td><span title="{$data.name}">{$data.name_text}</span></td>
                    <td>{$data.location}</td>
                    <td>{$data.evc_number}</td>
                    <td>{$data.key_link}</td>
                    <td>
                        <if condition="$data.charge eq 0 and $data.bespeak eq 0 and $data.error eq 1 and $data.cable eq 0">故障维护<else /></if>
                    </td>
                    <td>{$data.time}</td>
                    <td>
                        <a class="btn btn-success btn-sm" href="__URL__/detail/id/{$data.id}">
                            <i class="fa fa-eye"></i>
                            &nbsp;查看
                        </a>
                        <if condition="$_SESSION['role'] eq 805 or $_SESSION['role'] eq 802">
                            <a class="btn btn-sm btn-danger deleteBtn" href="#confirmDelete" data-target="#confirmDelete" data-toggle="modal" data-id='{$data.id}'><i class="fa fa-trash-o"></i>
                                &nbsp;删除</a>
                        <else /></if>
                    </td>
                </tr>
            </volist>
        </empty>
        <tr>
            <td colspan="99">
                <input type="button" value="全选"   class="btn selectAll">
                <input type="button" value="全不选" class="btn unSelect" >
                <input type="button" value="反选"   class="btn reverse" >
                <input type="button" value="批量删除" class="btn delValues" >
            </td>
        </tr>
    <else />
        <thead>
        <tr>
            <th>
                <button class='btn btn-block btn-mcit' type='button'>选择</button>
            </th>
            <th >
                <button class='btn btn-block btn-mcit' type='button'>ID</button>
            </th>
            <th >
                <button class='btn btn-block btn-mcit' type='button'>站点名称</button>
            </th>
            <th >
                <button class='btn btn-block btn-mcit' type='button'>所在区域</button>
            </th>
            <th>
                <button class='btn btn-block btn-mcit' type='button'>运营二维码</button>
            </th>
            <th>
                <button class='btn btn-block btn-mcit' type='button'>设备地址</button>
            </th>
            <th>
                <button class='btn btn-block btn-mcit' type='button'>电桩状态</button>
            </th>
            <th>
                <button class='btn btn-block btn-mcit' type='button'>在线情况</button>
            </th>
            <th>
                <button class='btn btn-block btn-mcit' type='button'>24小时</button>
            </th>
            <th>
                <button class='btn btn-block btn-mcit' type='button'>操作</button>
            </th>
        </tr>
        </thead>
        <tbody>
        <empty name="charState">
            <td colspan="99" style="text-align:center" class="danger"> <strong><i class="fa fa-meh-o"></i>
                &nbsp;&nbsp;当前条件下没有数据</strong>
            </td>
        <else />
            <volist name="charState" id="data">
                <tr class="lists" align="center">
                    <td>
                        <input type="checkbox" data-nid="{$data.evc_number}" data-id="{$data.s_key_link}" data-code="{$data.now_user}" value="{$data.id}"/>
                    </td>
                    <td>{$data.id}</td>
                    <td>
                        <span title="{$data.name}">{$data.name_text}</span>
                    </td>
                    <td>{$data.location}</td>
                    <td>{$data.evc_number}</td>
                    <td>{$data.key_link}</td>
                    <td>
                        <if condition="$data.charge eq 1 and $data.error eq 0 and $data.bespeak eq 0 and $data.cable eq 0">
                            <span style="color: red">充电中</span>
                        <elseif condition="$data.charge eq 0 and $data.error eq 0 and $data.bespeak eq 1 and $data.cable eq 0"/>
                            <span style="color: #D3520C">预约中</span>
                        <elseif condition="$data.charge eq 0 and $data.error eq 0 and $data.bespeak eq 0 and $data.cable eq 0"/>
                            <span style="color: #009900">空闲中</span>
                        <else />故障维护</if>
                    </td>
                    <td>
                        <if condition="$data.status eq 2">
                            <span style="color: #cc6600">异常</span>
                        <elseif condition="$data.status eq 1"/>
                            <span style="color: red">下线(连续{$data.outline}天)</span>
                        <elseif condition="$data.status eq 3"/>
                            <span style="color: #009900">在线</span>
                        </if>
                    </td>
                    <td>
                        <a class="btn btn-sm {$data.colors} showState " href="#confirmDeletes" data-target="#confirmDeletes" data-toggle="modal" data-id='{$data.key_link}'>
                            <i class="glyphicon glyphicon-flash"></i>
                        </a>
                    </td>
                    <td>
                        <a class="btn btn-success btn-sm" href="__URL__/detail/id/{$data.id}">
                            <i class="fa fa-eye"></i>
                            &nbsp;查看
                        </a>
                        <if condition="$data.charge eq 1 and $data.error eq 0 and $data.bespeak eq 0 and $data.cable eq 0">
                            <a class="btn btn-danger btn-sm changehh"  data-nid="{$data.evc_number}"  data-value="关闭" data-text="{$data.now_user}"  data-id="{$data.s_key_link}" data-info="确定要关闭？">
                                <i class="fa fa-sign-out"></i>
                                &nbsp;关闭
                            </a>
                            <a class="btn btn-info btn-sm changehh"  data-nid="{$data.evc_number}"   data-value="预约"  data-text="{$data.now_user}"   data-id="{$data.s_key_link}" data-info="确定开始预约吗”？">
                                <i class="fa fa-adjust"></i>
                                &nbsp;预约
                            </a>
                            <elseif condition="$data.charge eq 0 and $data.error eq 0 and $data.bespeak eq 1 and $data.cable eq 0"/>
                            <a class="btn btn-success btn-sm changehh" data-nid="{$data.evc_number}"  data-value="开启" data-text="{$data.now_user}"  data-id="{$data.s_key_link}" data-info="确定要开启吗？">
                                <i class="fa fa-sign-in"></i>
                                &nbsp;开启
                            </a>
                            <a class="btn btn-warning btn-sm changehh" data-nid="{$data.evc_number}"  data-value="消约" data-text="{$data.now_user}"   data-id="{$data.s_key_link}" data-info="确定取消预约吗？">
                                <i class="fa fa-circle"></i>
                                &nbsp;消约
                            </a>
                            <elseif condition="$data.charge eq 0 and $data.error eq 0 and $data.bespeak eq 0 and $data.cable eq 0"/>
                            <a class="btn btn-success btn-sm changehh" data-nid="{$data.evc_number}"  data-value="开启"  data-text="{$data.now_user}" data-id="{$data.s_key_link}" data-info="确定要开启吗？">
                                <i class="fa fa-sign-in"></i>
                                &nbsp;开启
                            </a>
                            <a class="btn btn-info btn-sm changehh"  data-nid="{$data.evc_number}"   data-value="预约"   data-text="{$data.now_user}" data-id="{$data.s_key_link}" data-info="确定开始预约吗”？">
                                <i class="fa fa-adjust"></i>
                                &nbsp;预约
                            </a>
                        </if>
                        <if condition="$_SESSION['role'] eq 805 or $_SESSION['role'] eq 802">
                            <a class="btn btn-sm btn-danger deleteBtn" href="#confirmDelete" data-target="#confirmDelete" data-toggle="modal" data-id='{$data.id}'><i class="fa fa-trash-o"></i>
                                &nbsp;删除</a>
                        <else /></if>
                    </td>
                </tr>
            </volist>
        </empty>
        <tr>
            <td colspan="99">
                <input type="button" value="全选"   class="btn selectAll">
                <input type="button" value="全不选" class="btn unSelect" >
                <input type="button" value="反选"   class="btn reverse" >
                <input type="button" value="批量删除" class="btn delValues" >
                <input type="button" value="开启" class="btn startValues btn-success" >
                <input type="button" value="关闭" class="btn endValues btn-danger" >
                <input type="button" value="预约" class="btn bespeakValues btn-info" >
                <input type="button" value="消约" class="btn cancelValues btn-warning" >
            </td>
        </tr>
    </if>
    <tr>
        <td colspan="99" style="text-align:center">
            <ul class="pagination">{$pageView}</ul>
        </td>
    </tr>
    </tbody>
    </table>
<input type="hidden" name="fsign" id="fsign" value="normal">
</form>
</div>
</div>
<!-- 删除 -->
<div id="confirmDelete" class="modal  fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 id="myModalLabel">是否确认删除？</h4>
            </div>
            <div class="modal-body" style="color: #D2322D">
                注意！删除后当前状态将不可恢复。
            </div>
            <div class="modal-footer">
                <a class="btn" data-dismiss="modal" aria-hidden="true" id="modelClose">关闭</a>
                <a class="btn btn-primary" id="confirmDeleteBtn">确定</a>
            </div>
        </div></div>
    <div class="hide" id="cache">1</div>
</div>
<!-- 24小时-弹窗 -->
<div id="confirmDeletes" class="modal  fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" onclick="executes()" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4>心跳记录数
                    <a onClick="today(this);" class="totoday" data-nid=""  style="float: right;margin-right:30px;cursor:pointer">今日心跳记录数</a>
                </h4>
                <input type="hidden" name="key_link" class="keys"/>
                <div class="panel-body search-panel-body">
                    <div class="col-xs-7 search-col">
                        <div class="input-group">
                            <span class="input-group-addon">时间段</span>
                            <input type="text" class="form-control required form_month" placeholder="点击选择" name="start_time"   data-date-format="yyyy-mm-dd" data-link-format="yyyy-mm-dd" value="{$_GET['start_time']}">
                            <span class="input-group-addon">~~</span>
                            <input type="text" class="form-control required form_month" placeholder="点击选择"  name="end_time"  data-date-format="yyyy-mm-dd" data-link-format="yyyy-mm-dd" value="{$_GET['end_time']}">
                        </div>
                    </div>
                    <div class="col-xs-2 search-col">
                        <button  type="button" class="btn btn-warning search_heart">
                            <i class="fa fa-search"></i>
                            &nbsp;搜索
                        </button>
                    </div>
                </div>
            </div>
            <div class="modal-body alert-danger showToday" id="stateHtml" align="center" >

            </div>
            <div class="modal-footer">
                <a class="btn btn-default btn-sm" onclick="executes()" data-dismiss="modal" aria-hidden="true" id="modelCloses">关闭</a>
            </div>
        </div></div>
    <div class="hide" id="caches">1</div>
</div>
<import file="js.jquery#chained"/>
<import type='css' file="css.datetimepicker" />
<import file="js.bootstrap-datetimepicker#min" />
<import file="js.bootstrap-datetimepicker#zh-CN" />
<import file="js.maskedinput" />
<import file="js.jQuery#md5" />
<script type="text/javascript">
	function getRandomNum(Min,Max)
	{
	var Range = Max - Min;   
	var Rand = Math.random();
    var ss = Min + Math.round(Rand * Range);
	return(Min + Math.round(Rand * Range));   
	}
	
	function getToken(hao,randomKey)
	{
		var one = hao.substr(0, 4);
		var two = hao.substr(4,12);
		one = $.md5(one);
		two = $.md5(two);

		//var randomKey=getRandomNum(1,10);
		var result = one + randomKey + two;
		result = $.md5(result);
		return (result);

	}
</script>	


<script type="text/javascript">
    $(document).ready(function () {

        $("#location-s").chained("#location-f");
        $("#location-t").chained("#location-s");
        $(".form_month").datetimepicker({
            language: 'zh-CN',
            autoclose: true,
            startView:'month',
            minView: 'month',
            todayBtn: true,
            viewSelect: 'year',
            pickerPosition: "bottom-left"
        });
        var int;
        executes();
    });
    function executes(){
        var seconds = 0;
        int = setInterval(function(){
            seconds += 1;
            document.getElementById('countdown').innerHTML = 60-seconds;
            if(seconds == 60){
                location.reload();
            }
        },1000);
        return int;
    }
</script>
<script type="text/javascript">

    //当前时间以前的每小时心跳记录数
    function today(e){
        $(".showToday").html('<i class="fa fa-spinner fa-spin"></i>&nbsp;系统正在查询中...');
        var key = $(e).attr("data-nid");
        $.ajax({
            type:"get",
            url:'__URL__/todayState',
            data:'key_link='+key,
//                dataType:"json",
            success:function(data){
                //数据显示处理。。。
                $(".showToday").html(data);
            }
        });
    }

    $(document).ready(function () {

        //24小时心跳
        $(".showState").click(function (){
            window.clearInterval(int);//停止刷新
            var key_link = $(this).attr("data-id");
            //alert(key_link);
            $.ajax({
                type:"get",
                url:'__URL__/showState',
                data:'key_link='+key_link,
//                dataType:"json",
                success:function(data){
                    //数据显示处理。。。
                    $("#stateHtml").html(data);
                    var key = $(".keylink").val();
                    $(".totoday").attr("data-nid",key);
                    $(".keys").val(key);
                }
            });
        });


        //历史心跳记录显示
        $(".search_heart").click(function(){
            $(".showToday").html('<i class="fa fa-spinner fa-spin"></i>&nbsp;系统正在查询中...');
            var keylink    = $(".keys").val();
            var start_time = $("input[name='start_time']").val();
            var end_time   = $("input[name='end_time']").val();
            if(start_time != ''){
                $.ajax({
                    type:"get",
                    url:'__URL__/search_heart',
                    data:'key_link='+keylink+'&start_time='+start_time+'&end_time='+end_time,
//                dataType:"json",
                    success:function(data){
                        //数据显示处理。。。
                        $("#stateHtml").html(data);
                    }
                });
            }else{
                alertify.error("开始时间不能为空！");
            }
        });

        $(document).on("click",'.changehh',function(){
            var obj           = $(this).parent();
            var stateKey      = $(this).attr("data-id");//设备地址
            var userCard      = $(this).attr("data-text");//会员卡号
            var info          = $(this).attr("data-info");//提示内容
            var value         = $(this).attr("data-value");//执行状态
            var evNumber      = $(this).attr("data-nid");//运营二维码
            var url           = "http://id.dz.tt/listen/send8089_v3.php?";
            var sendData      = '';
            var now_user      = '';
            var code          = '';
            var key           = getRandomNum(10,99);
            var token         = getToken(evNumber,key);
            if(userCard == '' || userCard == 0){
                now_user = "01234567890123456789";
            }else{
                now_user = userCard;
            }
            //下发操作指令
            if(value == "开启"){
                code     = "410104";
            }else if(value == "关闭"){
                code     = "410401";
            }else if(value == "预约"){
                code     = "9302";
            }else if(value == "消约"){
                code     = "9301";
            }
            alertify.confirm(info, function (e) {
                if (e) {
                    sendData = 'code='+code+'&key='+key+'&userCard='+now_user+'&token='+token+'&evCharNumber='+evNumber;
                    $.get(url+sendData);
                    //location.reload();
                } else {
                    alertify.error("取消操作！");
                }
            }, "mcit_default");
        });
    })
</script>
<script type="text/javascript">
    function show_first_page(){
        $("#fsign").val("abnormal");
        return true;
    }
    $(document).ready(function () {

        $(".deleteBtn").click(function (){
            var id = $(this).attr("data-id");
            $("#cache").val(id);
        });
        $("#confirmDeleteBtn").click(function (){
            var id = $("#cache").val();
            //alert(id);
            $.ajax({
                type:"get",
                url:'__URL__/delState',
                data:'id='+id,
                success:function(data){
                    if(data == 1){
                        alertify.success("删除成功！");
                    }else{
                        alertify.error("删除失败，请重新提交！");
                    }
                    location.reload();
                }
            });
        });
    })
</script>
<script type="text/javascript">

	
    $(document).ready(function () {

        //全选
        $(".selectAll").click(function () {
            $(".lists :checkbox").prop("checked", true);
        });
        //全不选
        $(".unSelect").click(function () {
            $(".lists :checkbox").prop("checked", false);
        });
        //反选
        $(".reverse").click(function () {
            $(".lists :checkbox").each(function () {
                $(this).prop("checked", !$(this).prop("checked"));
            });
        });
        //开启命令
        $(".startValues").click(function(){
            var valArray = new Array;
            $("input[type='checkbox']:checked").prop("checked", function(i) {
                valArray[i] = $(this).attr("data-id");
            });
            var values = valArray.join(',');
            if(values == ''){
                alert("请选择要处理的选项!");
            }else{
                alertify.confirm("确定处理吗？", function (e) {
                    if (e) {
                        var url      = "http://id.dz.tt/listen/send8089_v3.php?";
                        var code     = "410104";
                        var sendData = '';
                        var now_user = '';
                        $("input[type='checkbox']:checked").prop("checked", function(i) {
                            var evNumber = $(this).attr("data-nid");//运营二维码
                            var userCard = $(this).attr("data-code");//会员卡号
                            if(userCard == '' || userCard == 0){
                                now_user = "01234567890123456789";
                            }else{
                                now_user = userCard;
                            }
                            var key      = getRandomNum(10,99);
                            var token    = getToken(evNumber,key);
                            sendData     = 'code='+code+'&key='+key+'&userCard='+now_user+'&token='+token+'&evCharNumber='+evNumber;
                            $.get(url+sendData);
                        });
                    } else {
                        alertify.error("取消操作！");
                    }
                }, "mcit_default");
            }
        });
        //关闭命令
        $(".endValues").click(function(){
            var valArr = new Array;
            $("input[type='checkbox']:checked").prop("checked", function(i) {
                valArr[i] = $(this).attr("data-id");
            });
            var vals = valArr.join(',');
            if(vals == ''){
                alert("请选择要处理的选项!");
            }else{
                alertify.confirm("确定处理吗？", function (e) {
                    if (e) {
                        var url      = "http://id.dz.tt/listen/send8089_v3.php?";
                        var code     = "410401";
                        var sendData = '';
                        var now_user = '';
                        $("input[type='checkbox']:checked").prop("checked", function(i) {
                            var evNumber = $(this).attr("data-nid");//运营二维码
                            var userCard = $(this).attr("data-code");//会员卡号
                            if(userCard == '' || userCard == 0){
                                now_user = "01234567890123456789";
                            }else{
                                now_user = userCard;
                            }
                            var key      = getRandomNum(10,99);
                            var token    = getToken(evNumber,key);
                            sendData     = 'code='+code+'&key='+key+'&userCard='+now_user+'&token='+token+'&evCharNumber='+evNumber;
                            $.get(url+sendData);
                        });
                    } else {
                        alertify.error("取消操作！");
                    }
                }, "mcit_default");
            }
        });
        //预约命令
        $(".bespeakValues").click(function(){
            var valArr = new Array;
            $("input[type='checkbox']:checked").prop("checked", function(i) {
                valArr[i] = $(this).attr("data-id");
            });
            var vals = valArr.join(',');
            if(vals == ''){
                alert("请选择要处理的选项!");
            }else{
                alertify.confirm("确定处理吗？", function (e) {
                    if (e) {
                        var url      = "http://id.dz.tt/listen/send8089_v3.php?";
                        var code     = "9302";
                        var sendData = '';
                        var now_user = '';
                        $("input[type='checkbox']:checked").prop("checked", function(i) {
                            var evNumber = $(this).attr("data-nid");//运营二维码
                            var userCard = $(this).attr("data-code");//会员卡号
                            if(userCard == '' || userCard == 0){
                                now_user = "01234567890123456789";
                            }else{
                                now_user = userCard;
                            }
                            var key      = getRandomNum(10,99);
                            var token    = getToken(evNumber,key);
                            sendData     = 'code='+code+'&key='+key+'&userCard='+now_user+'&token='+token+'&evCharNumber='+evNumber;
                            $.get(url+sendData);
                        });
                        
                    } else {
                        alertify.error("取消操作！");
                    }
                }, "mcit_default");
            }
        });
        //取消预约命令
        $(".cancelValues").click(function(){
            var valArr = new Array;
            $("input[type='checkbox']:checked").prop("checked", function(i) {
                valArr[i] = $(this).attr("data-id");
            });
            var vals = valArr.join(',');
            if(vals == ''){
                alert("请选择要处理的选项!");
            }else{
                alertify.confirm("确定处理吗？", function (e) {
                    if (e) {
                        var url         = "http://id.dz.tt/listen/send8089_v3.php?";
                        var code        = "9301";
                        var now_user    = "";
                        var sendData    = '';
                        $("input[type='checkbox']:checked").prop("checked", function(i) {
                            var evNumber  = $(this).attr("data-nid");//运营二维码
                            var user_card = $(this).attr("data-code");//会员卡号
                            if(user_card != 0 || user_card != ''){
                                now_user  = user_card;
                            }else{
                                now_user  = "01234567890123456789";
                            }
                            var key      = getRandomNum(10,99);
                            var token    = getToken(evNumber,key);
                            sendData     = 'code='+code+'&key='+key+'&userCard='+now_user+'&token='+token+'&evCharNumber='+evNumber;
                            $.get(url+sendData);
                        });
                    } else {
                        alertify.error("取消操作！");
                    }
                }, "mcit_default");
            }
        });
        //批量删除
        $(".delValues").click(function(){
            var valArray = new Array;
            $("input[type='checkbox']:checked").prop("checked", function(i) {
                valArray[i] = $(this).val();
            });
            var values = valArray.join(',');
            if(values == ''){
                alert("请选择要处理的数据!");
            }else{
                //alert(values);
                alertify.confirm("确定删除吗？", function (e) {
                    if (e) {
                        $.ajax({
                            type: "POST",
                            url:  '{:U("State/delState")}',
                            data: {ids:values},
                            dataType: "json",
                            success: function(data){
                                if(data.state==100){
                                    alertify.success(data.msg);
                                }else{
                                    alertify.error(data.msg);
                                }
                                location.reload();
                            }
                        });
                    } else {
                        alertify.error("取消操作！");
                    }
                }, "mcit_default");
            }
        });
    });
</script>